package homework;

import java.util.Arrays;

public class VerbReverse {
    public static void main(String[] args) {
        //将单词翻转 i am a student -> student a am i
        String a = "i am a student";
        String b = "";
        String[] s = a.split(" ");
        System.out.println(Arrays.toString(s));
        //反转数组
        for(int i=s.length-1;i>=0;i--){
            b+=s[i];
            b = b+" ";
        }
        System.out.println(b);
    }
}
